//dev环境
let fs = require('fs');
let file = '/../app-config.js';


//环境配置
let con = {
  apiHost: 'http://10.200.10.22:28080',
  // uploadHost: 'http://piao.gome.com.cn',
  // imgHost: 'http://piao.gome.com.cn',
  // xxxHost: 'http://piao.gome.com.cn',
};


fs.readFile(__dirname + file, 'utf-8', function (err, data) {
  data = data.replace(/apiHost:('|")?(.*)('|")?,/g, "apiHost: '" + con.apiHost + "',");
  fs.writeFile(__dirname + file, data, function (err) {
    if (err) {
      console.log("error! " + file);
      console.log(err);
    } else {
      console.log("change env success! ");
    }
  });
});
